Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up to use pytest for our data-driven tests, and switch testcheck over to it #1944

Merged
merged 15 commits into from
Jul 27, 2016
Merged
Prev Previous commit
Next Next commit
tweaks for polish
  • Loading branch information
gnprice committed Jul 27, 2016
commit 8c051dce167b2a653f618fc32ada0dcaccc9012e
6 changes: 4 additions & 2 deletions mypy/test/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def parse_test_cases(
"""Parse a file with test case descriptions.

Return an array of test cases.

NB this function and DataDrivenTestCase are shared between the
myunit and pytest codepaths -- if something looks redundant,
that's likely the reason.
"""

if not include_path:
Expand Down Expand Up @@ -356,8 +360,6 @@ def pytest_addoption(parser):
def pytest_pycollect_makeitem(collector, name, obj):
if not isinstance(obj, type) or not issubclass(obj, DataSuite):
return None
#os.write(3, ('collecting: %r %r %r\n' % (collector, name, obj)).encode('utf-8'))

return MypyDataSuite(name, parent=collector)


Expand Down
8 changes: 7 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
[pytest]
# testpaths is new in 2.8
minversion = 2.8

testpaths = mypy/test

python_files = test*.py
python_functions =

# empty patterns for default python collector, to stick to our plugin's collector
python_classes =
python_functions =
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
flake8
typed-ast
pytest>=2.9
pytest>=2.8