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

Replace nose with pytest #37

Merged
merged 2 commits into from
Aug 1, 2020
Merged

Replace nose with pytest #37

merged 2 commits into from
Aug 1, 2020

Conversation

MeggyCal
Copy link
Contributor

On Python 3.9 or 3.10 nose will stop working, so let us transform the tests to pytest.

Sorry, I do not know how to purge nose from Pipfile.lock, could you please do it yourself?

@MeggyCal MeggyCal force-pushed the master branch 2 times, most recently from aae596d to 634ea5e Compare July 24, 2020 07:27
@MeggyCal
Copy link
Contributor Author

Now I made it to run at least on ubuntu and macos. How do I set the PYTHONPATH on Windows, please?

@cscorley
Copy link
Owner

Hello,

Thank you so much for this change!

Instead of PYTHONPATH=, I think the preferred method is to run pytest directly in GitHub actions, according to this document: https://docs.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#testing-your-code

For my personal dev, I use pipenv: https://pipenv.pypa.io/en/latest/. I would ordinarily uninstall nose with pipenv uninstall nose, and then install pytest with pipenv install pytest --dev. I can fix pipenv after your changes :) It is not required by the build or publish.

@@ -43,4 +43,4 @@ jobs:

- name: Test
run: |
nosetests --with-doctest --doctest-extension=rst
PYTHONPATH=. py.test --doctest-modules --doctest-glob='*.rst'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be able to run without PYTHONPATH=

pytest --doctest-modules --doctest-glob='*.rst'

This works locally for me on Windows

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am quite certain I tried it (only with py.test, not pytest) and that it failed on Ubuntu

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Yes, you're right. It is still failing.

The only difference I see at this point between this branch and the documentation is that the documentation installs pytest in the same stage that it executes under. That could be the last possible difference, but I'm not sure why it would matter at all (I'd guess nose and pytest install differently).

I am happy to merge this change and then work on getting the build action working again separately. The changes themselves to the tests are good :)

@cscorley cscorley merged commit 2ece260 into cscorley:master Aug 1, 2020
cscorley pushed a commit that referenced this pull request Nov 13, 2022
* replace nose with pytest

* try to build it without PYTHONPATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants