Skip to content

Commit

Permalink
Partially support Node.from_parent deprecation in PyTest 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrink10 committed Mar 14, 2020
1 parent 44e140a commit 4c14890
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 64 deletions.
128 changes: 65 additions & 63 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/basilisp/testrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def pytest_collect_file(parent, path):
"""Primary PyTest hook to identify Basilisp test files."""
if path.ext == ".lpy":
if path.basename.startswith("test_") or path.purebasename.endswith("_test"):
return BasilispFile(path, parent)
if hasattr(BasilispFile, "from_parent"):
return BasilispFile.from_parent(parent, fspath=path)
else:
return BasilispFile(path, parent)
return None


Expand Down
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ exclude_lines =
if 0:
if __name__ == .__main__.:

[pytest]
junit_family = xunit2

[testenv:format]
deps =
black
Expand Down

0 comments on commit 4c14890

Please sign in to comment.