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

MNT: Replace testdir fixture with pytester #200

Open
pllim opened this issue Jun 7, 2023 · 5 comments
Open

MNT: Replace testdir fixture with pytester #200

pllim opened this issue Jun 7, 2023 · 5 comments

Comments

@pllim
Copy link
Contributor

pllim commented Jun 7, 2023

Example:

https://github.com/astropy/pytest-doctestplus/blob/e1eea63ebbdb36ef759c5c90e9ccd40d1a289d55/tests/test_doctestplus.py#L15

It is legacy now and has been replaced by pytester.

Blocked by:

  • Need to bump minversion of pytest to 6.2 or later.
@pllim
Copy link
Contributor Author

pllim commented Jun 7, 2023

Oh... pytester is too new for the versions of pytest we supposedly support. 😿

@bsipocz
Copy link
Member

bsipocz commented Jun 7, 2023

Hmm, I think, if needed, we can bump min pytest version to 6.2 once the org change happens. Is this a blocker for anything or would be just a cleanup?

(I think we shouldn't exactly follow SPEC0 in these testing plugins, e.g. it shouldn't be a plugin that forces a package to drop a python version, but once we pass a SPEC drop time we could be more relaxed to drop for any reason that makes maintainability easier)

@pllim
Copy link
Contributor Author

pllim commented Jun 7, 2023

Just a clean up. I don't see any deprecation warning, but it is in a file that is named "legacy" so that is a bit scary.

@bsipocz
Copy link
Member

bsipocz commented Jun 14, 2023

Hmm, while trying to run things on 3.12, I run into a lot of AttributeError: type object 'reprec' has no attribute 'assertoutcome', and keep wondering whether switching to pytester would solve that problem, too?

@pllim
Copy link
Contributor Author

pllim commented Jun 14, 2023

@bsipocz , maybe can experiment with just one test. The jobs with older pytest would fail, but if your theory is correct, that one test will no longer throw this error in newer pytest + Python 3.12. That said... might still be too early?

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

No branches or pull requests

2 participants