-
Notifications
You must be signed in to change notification settings - Fork 579
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
backport py3 testing enhancements #239
Conversation
expected, | ||
scope.__name__, | ||
len(features[feature]), | ||
) | ||
assert len(features[feature]) == expected, msg | ||
|
||
|
||
def get_extractor(path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might want to merge this routine with main.get_extractor()
at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 👍
@@ -57,3 +57,20 @@ jobs: | |||
- name: Run tests | |||
run: pytest tests/ | |||
|
|||
tests38: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be done with a matrix for the python version instead of duplicating the code. But as we want to get rid of Python 2 in the near future, I guess this won't have a long life anyway... 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, good point. though, then the linting would happen twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
though, then the linting would happen twice?
no, I meant changing tests
to the following (instead of duplicating tests
into tests27
and test38
:
tests:
name: Test in ${{ matrix.python }}
runs-on: ubuntu-latest
needs: [code_style, rule_linter]
strategy:
matrix:
include:
- python: 2.7
- python: 3.8
steps:
- name: Checkout capa with submodules
uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install capa
run: pip install -e .[dev]
- name: Run tests
run: pytest tests/
I can send a PR as this can be useful if we want to test several python versions.
backport py3 testing enhancements from #234. basically: wrap py2-only things in xfail annotations.
when we add a py3 backend, then all we need to do is update
fixtures::get_extractor()
to return the py3 backend on py3 and then re-run the tests. pytest will complain that things that we used to fail no longer fail, so go through and remove those xfail marks.