Takafumi Arakaki
fc79f0e258
Support case like from os.path import join as pjoin
2013-05-04 17:44:59 +02:00
Takafumi Arakaki
6fb42e5f4b
Document _import_raw_namespace more
2013-05-04 17:44:59 +02:00
Takafumi Arakaki
12ac71b1fd
Document api.Interpreter
2013-05-04 17:44:59 +02:00
Takafumi Arakaki
b4e3d1d65d
Fix test_complete_raw_instance example
...
'dt.strftime("%Y").up' does not work even if with `api.Script`.
Change it to the one that can be handled by Jedi.
2013-05-04 17:44:59 +02:00
Takafumi Arakaki
45cad4c83b
Fake imports should locate before fake statements
2013-05-04 17:44:59 +02:00
Takafumi Arakaki
06c03cafa2
Implement the case where raw object is an instance
...
There is still a bug in this implementation.
The corresponding test fails.
2013-05-04 17:44:58 +02:00
Takafumi Arakaki
11abd92d2b
Support alias in _make_fakeimport
2013-05-04 17:44:58 +02:00
Takafumi Arakaki
cf48d1272d
Use proper interface to add fake Import object
2013-05-04 17:44:58 +02:00
Takafumi Arakaki
17770356e2
Implement the case where raw object is a module
...
Previously failing test_complete_raw_module is passed.
2013-05-04 17:44:58 +02:00
Takafumi Arakaki
fb197c42ab
Add tests for api.Interpreter (2/3 fail)
2013-05-04 17:44:58 +02:00
Takafumi Arakaki
3266aa2d00
Improve api.Interpreter docstring
2013-05-04 17:43:37 +02:00
Takafumi Arakaki
842fbfce8a
Add api.Interpreter: Jedi API for Python REPLs
2013-05-04 17:43:37 +02:00
Takafumi Arakaki
944b3200a0
Fix allow_failures syntax
...
allow_failures.env requires a string when matrix/global is not used?
Also, indent is changed to fit with other entries.
2013-04-10 17:28:15 +02:00
Takafumi Arakaki
658bcb6421
Install coveralls only when needed
2013-04-10 17:23:50 +02:00
Takafumi Arakaki
8e4a76ca1b
Allow TOXENV=cov to fail in travis-ci
2013-04-10 17:09:36 +02:00
Takafumi Arakaki
af22409059
Separate tox env for coverage check
2013-04-10 17:08:20 +02:00
Takafumi Arakaki
aca1cbfa4b
Use "jedi/cpython-27" instead of "jedi/2.7" for FS cache
2013-03-20 16:46:55 +01:00
Takafumi Arakaki
27d007adba
Compare version using "!="
...
Cache is not forward compatible.
2013-03-20 12:21:22 +01:00
Takafumi Arakaki
942b66ba5b
Separate directory for each Python version
2013-03-20 12:21:22 +01:00
Takafumi Arakaki
f8d3339f2f
Remove old version of FS cache automatically
2013-03-20 12:21:22 +01:00
Takafumi Arakaki
8734e0efe2
Use cPickle if available
2013-03-19 20:33:15 +01:00
Takafumi Arakaki
d1150cfdae
List allowed attributes in Generator.__getattr__
2013-03-17 13:56:54 +01:00
Takafumi Arakaki
2cc6edfa7c
Fix Completion.follow_definition
2013-03-16 22:57:31 +01:00
Takafumi Arakaki
6a2e535bcb
Add er.Generator.__getattr__
2013-03-16 21:50:05 +01:00
Takafumi Arakaki
c25ee531a2
AttributeError: 'Generator' object has no attribute 'start_pos'
...
Running py.test raises this error:
```tb
test/test_api_classes.py:50: in <module>
> @pytest.mark.parametrize('definition', make_definitions())
test/test_api_classes.py:38: in make_definitions
> definitions += script.definition()
jedi/api_classes.py:44: in wrapper
> result = func(*args, **kwds)
jedi/api.py:274: in definition
> if not isinstance(s, imports.ImportPath._GlobalNamespace)])
jedi/api_classes.py:418: in __init__
> super(Definition, self).__init__(definition, definition.start_pos)
E AttributeError: 'Generator' object has no attribute 'start_pos'
```
2013-03-16 21:50:05 +01:00
Takafumi Arakaki
febc65be6f
Skip test_no_duplicate_modules for jedi.__init__
2013-03-16 21:28:27 +01:00
Takafumi Arakaki
4aac06eb86
Remove tags for known failures due to the import hack
2013-03-16 21:18:37 +01:00
Takafumi Arakaki
f5fee5f0df
Fix wrong imports
...
- "from _compatibility import ..." (not in circular imports)
- "from jedi import builtin" (one of circular imports)
- "api_classes = api.api_classes"
("from jedi import api_classes" is not supported)
2013-03-16 21:03:34 +01:00
Takafumi Arakaki
07ba6658dd
Add test_no_duplicate_modules
2013-03-16 20:44:00 +01:00
Takafumi Arakaki
df08122639
Fix a failure when run with Python 3
2013-03-15 14:51:59 +01:00
Takafumi Arakaki
be33f0ad98
Fix previously failing test_follow_definition
2013-03-15 14:39:51 +01:00
Takafumi Arakaki
c8c1113c55
Test generator and lambda
2013-03-15 14:26:58 +01:00
Takafumi Arakaki
a0c796087a
Generate "param" definition in make_definitions
2013-03-15 14:24:42 +01:00
Takafumi Arakaki
956ad50276
Make more examples in make_definitions
2013-03-15 14:13:55 +01:00
Takafumi Arakaki
f791e96d9d
Fix failing test_basedefinition_type
2013-03-15 13:54:19 +01:00
Takafumi Arakaki
3caebcb5aa
Add test_basedefinition_type
2013-03-15 13:54:17 +01:00
Takafumi Arakaki
f70e425c4a
Lowercase the str returned by BaseDefinition.type
2013-03-15 13:08:55 +01:00
Takafumi Arakaki
6659a532ac
Remove --assert=plain
2013-03-15 00:25:10 +01:00
Takafumi Arakaki
7cf70a3f0a
Do not clear cache in __del__
...
Prior to this change, running
`py.test --assert=rewrite test/test_integration.py` fails with errors
due to:
```py
cls = <class 'jedi.recursion.ExecutionRecursionDecorator'>
@classmethod
def cleanup(cls):
> cls.parent_execution_funcs.pop()
E IndexError: pop from empty list
recursion.py:127: IndexError
```
Similar errors occurred in travis occasionally:
- https://travis-ci.org/davidhalter/jedi/jobs/5449831
- https://travis-ci.org/davidhalter/jedi/jobs/5512538
I think this is because GC calls __del__ at random point during
actual execution of ExecutionRecursionDecorator.__call__.
As --assert=rewrite works by AST dynamically, I guess that it
is harder for Python's GC to clean up code and therefore GC
happens sometime later. Although this is just a random guess,
as `tox -- --assert=rewrite` works with this patch now, I think
this is a good change.
2013-03-15 00:21:46 +01:00
Takafumi Arakaki
841d46684f
Skip test in Python 3. It is a known bug.
...
See: #161
2013-03-14 22:21:58 +01:00
Takafumi Arakaki
edc7148320
Fix test_modulepickling_change_cache_dir failure
2013-03-14 22:15:34 +01:00
Takafumi Arakaki
860cf7b974
Add test_modulepickling_change_cache_dir
2013-03-14 22:15:07 +01:00
Takafumi Arakaki
ee03f3ae0d
Use pytest_(un)configure to setup cache_directory
2013-03-14 20:43:10 +01:00
Takafumi Arakaki
95aed3c54e
Exclude docs directory from test search
2013-03-14 19:20:20 +01:00
Takafumi Arakaki
3881f8d6ed
Do not collect setup.py as a test
2013-03-14 14:31:32 +01:00
Takafumi Arakaki
fbccdd3f70
Run doctests in the main py.test run
2013-03-14 14:15:00 +01:00
Takafumi Arakaki
3d647d3f3d
Use --quiet when installing tox
2013-03-14 10:35:20 +01:00
Takafumi Arakaki
191e8f690b
Simplify .travis.yml
2013-03-14 10:33:28 +01:00
Takafumi Arakaki
7a9e374a65
Use original exception value when reraise
2013-03-13 23:54:19 +01:00
Takafumi Arakaki
93bd00bba4
Document rethrow_uncaught/reraise
2013-03-13 23:50:40 +01:00
Takafumi Arakaki
2b89dda5a6
Use reraise when re-raising MultiLevelStopIteration
2013-03-13 23:28:53 +01:00
Takafumi Arakaki
3b78b52204
Rename MultiLevelAttributeErro to UncaughtAttributeError
2013-03-13 23:24:26 +01:00
Takafumi Arakaki
eca0f01cfb
Use @common.rethrow_uncaught and stop manual re-raise
2013-03-13 23:21:49 +01:00
Takafumi Arakaki
e42ff9e762
Add common.rethrow_uncaught
2013-03-13 23:21:15 +01:00
Takafumi Arakaki
dccda224ab
Hide api_classes.defined_names
2013-03-13 22:18:50 +01:00
Takafumi Arakaki
8d54ebea7b
Fix BaseDefinition.module_name
2013-03-13 22:05:59 +01:00
Takafumi Arakaki
125a3b1a6b
Document BaseDefinition.module_name
2013-03-13 22:05:31 +01:00
Takafumi Arakaki
2f7797f867
Ignore known failure in BaseDefinition.description doctest
...
See: #162
2013-03-13 21:44:55 +01:00
Takafumi Arakaki
a449428391
Document BaseDefinition.full_name
2013-03-13 20:30:36 +01:00
Takafumi Arakaki
9e3e6a2eea
Document BaseDefinition.description
2013-03-13 20:29:02 +01:00
Takafumi Arakaki
41b33fd460
Document BaseDefinition.doc
2013-03-13 20:11:14 +01:00
Takafumi Arakaki
f9ed3d42f7
Document BaseDefinition.type
2013-03-13 20:01:43 +01:00
Takafumi Arakaki
c8c26f52b9
Fix ImportError when building Sphinx
2013-03-12 19:35:20 +01:00
Takafumi Arakaki
ab5266b840
Automatically skip thirdparty test if not importable
2013-03-12 13:51:33 +01:00
Takafumi Arakaki
4866b38bda
Make VIRTUAL_ENV actually importable
2013-03-12 13:08:47 +01:00
Takafumi Arakaki
e5b660b0a1
Use PIP_INSECURE=t only in Python 2.5 test
2013-03-12 11:33:01 +01:00
Takafumi Arakaki
de7092d56b
Fix: --thirdparty was not considered
2013-03-12 11:26:58 +01:00
Takafumi Arakaki
c87d3dad52
Remove unused imports
2013-03-12 11:04:15 +01:00
Takafumi Arakaki
c387bf06bc
No need to setup import path in test.base
...
py.test does that for us.
2013-03-12 11:03:12 +01:00
Takafumi Arakaki
446c7cf694
Document how to run test
2013-03-12 10:36:42 +01:00
Takafumi Arakaki
1fffbf13ca
Fix test failures because imports.py uses base.py
2013-03-12 10:18:18 +01:00
Takafumi Arakaki
b5764c1446
Remove old utility functions in test.base
2013-03-12 10:11:26 +01:00
Takafumi Arakaki
ff80988a75
Remove old test code
2013-03-12 10:02:19 +01:00
Takafumi Arakaki
49f635dca3
Add a failing test due to import hack
2013-03-12 10:01:57 +01:00
Takafumi Arakaki
7c289ce6be
Workaround test failure due to cache in Python 3.2
2013-03-12 09:59:30 +01:00
Takafumi Arakaki
cee167e3d2
Run py.test in clean cache directory
...
And finally remove XDG_CACHE_HOME=... in tox.ini.
2013-03-12 09:30:13 +01:00
Takafumi Arakaki
5c3252908f
Use PIP_INSECURE=t
2013-03-12 09:29:00 +01:00
Takafumi Arakaki
ab33400f76
Install libbluetooth-dev for Python 2.5
2013-03-12 09:21:30 +01:00
Takafumi Arakaki
135dd56e61
Install libssl-dev for Python 2.5
2013-03-12 09:15:30 +01:00
Takafumi Arakaki
9e600ed0b1
Use --insecure when running pip with Python 2.5
2013-03-12 09:04:56 +01:00
Takafumi Arakaki
e7b352b826
Install ssl in .travis.yml
2013-03-12 09:01:56 +01:00
Takafumi Arakaki
674743b7bb
Avoid NoSSLError in Python 2.5
2013-03-12 08:49:24 +01:00
Takafumi Arakaki
88adcbcf8a
Use tox in .travis.yml
2013-03-12 08:03:55 +01:00
Takafumi Arakaki
13b48632e5
Better assertion message formatter
2013-03-12 07:58:40 +01:00
Takafumi Arakaki
71bb93224d
Ignore first N failures in Python 2.5
2013-03-12 07:48:20 +01:00
Takafumi Arakaki
180d0a8764
Rename regression.py to test_regression.py
...
in order to let py.test collect the tests.
2013-03-12 07:12:44 +01:00
Takafumi Arakaki
0f9761aac7
Fix tests for Python 3.2 (use relative import)
2013-03-12 07:11:37 +01:00
Takafumi Arakaki
51a094be02
Run py.test in tox.ini
2013-03-12 07:08:52 +01:00
Takafumi Arakaki
a993dd0da4
Fix test_refactor
...
It was not run because test cases were collected from test/complete
instead of test/refactor.
2013-03-12 07:00:44 +01:00
Takafumi Arakaki
a31ba8737a
Run refactoring test using py.test
...
refactor.collect_file_tests is fixed; it uses global variable
refactoring_test_dir which is not defined when refactor is used
as a module.
2013-03-12 06:50:03 +01:00
Takafumi Arakaki
9791f04555
Reduce args for RefactoringCase
2013-03-10 23:06:42 +01:00
Takafumi Arakaki
2362e290d8
Separate methods in RefactoringCase
2013-03-10 23:06:41 +01:00
Takafumi Arakaki
0a13b8f114
Separate test collection and run in refactoring.py
2013-03-10 23:06:39 +01:00
Takafumi Arakaki
50e1fad8f6
Remove tests from regression.py
2013-03-10 21:29:09 +01:00
Takafumi Arakaki
fa231b58a8
Add more test cases in completion/definition.py
2013-03-10 21:29:09 +01:00
Takafumi Arakaki
5f49fb8c7c
Add blackbox tests using column number
2013-03-10 21:29:09 +01:00
Takafumi Arakaki
31df9a92fe
Add test/completion/definition.py
2013-03-10 21:29:09 +01:00
Takafumi Arakaki
c6c17d7ed5
Add known failing test for function_definition
2013-03-10 21:29:09 +01:00
Takafumi Arakaki
ab79689cee
Use unittest2 for Python < 2.7
2013-03-10 21:28:27 +01:00
Takafumi Arakaki
3542b7f80a
Refactor tests for function_definition
2013-03-10 21:27:34 +01:00