-
Notifications
You must be signed in to change notification settings - Fork 295
Refactor tests and metadata #317
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
Conversation
In the commit message, is it a new version of |
The commit messages correctly said pytest; my note at the top about a new version of pylint didn't. |
e149ea5
to
ab0f966
Compare
6ad7999
to
8b186c7
Compare
del fun | ||
return f'test{x.args[0].capitalize()}Sample-{x.args[1]}' | ||
|
||
@parameterized.expand([(folder, case[:-4]) |
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.
Do we still need https://github.com/wolever/parameterized that has had no update in two years, when pytest has https://docs.pytest.org/en/stable/how-to/parametrize.html#parametrize builtin?
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.
That was the first thing I tried. I couldn't get that to work with the unittest-module–subclass setup in this repo. (Plas speling is very importent.)
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.
It is not tested on Python 3.12, 3.13, and pytest > v3 (current is v8). See the open issues and
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.
Well, this seems like the best thing we have. We could always find an alternative solution later. It doesn't seem like parameterized's actual functionality we use has been impacted by their indeed-worrying neglect yet. (This was a reason I also tried the subtests approach, which works without additional modules but doesn't allow for -k filtering.)
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.
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.
With #332 I do not see why we need unittest.TestCase
classes. I will do more work on that today.
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.
I think we'd have a less messy branch history if we just merge this now while you work on that.
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.
#322 has now removed all instances of unittest.TestCase
.
Interestingly, the pre-commit CI is complaining about something that's not even part of this PR's base yet. Will rebase. |
3ea4cc1
to
ccc9a82
Compare
self.assertEqual(0, status) | ||
self.assertEqual(b'', out) | ||
self.assertTrue(err.startswith(b'\nSyntax: cpplint')) | ||
|
||
class TemporaryFolderClassSetup(object): | ||
|
||
class TemporaryFolderClassSetup(unittest.TestCase): |
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.
Why this change?
Can we remove it and use pytest parameterize instead of the unmaintained library?
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.
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 is just a linting thing to show the override hints in PyCharm. It works exactly the same without this change.
I've mentioned that subtests were tried and not filterable in a comment above.
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.
You tried with pytest-subtests
instead of wolever/parameterized
?
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.
I don't think parameterized even has subtests support. Yes, I tried both unitest's own subtests and pytest-subtests. See pytest-dev/pytest-subtests#100.
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.
#332 has now removed all instances of unittest.TestCase
.
That is still a draft, no? Do you want to me to replace your PR's unittest file with the black-formatted one I provided and then merge it?
|
Please rebase this so we can merge it. |
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.
I approve this after:
- The git conflicts are cleared, and
- All GitHub Actions tests pass.
* merge pylint config * make version dynamic * better list of maintainers and major authors * remove "test" extra which now just duplicates "dev" * remove weird duplicated "testing" extra * remove setuptools—a build-system.requires—from optional requirements * remove unneeded pytest alias * more and better keywords (this is PyPI, we don't need a "Python" keyword * shorter desc
fix a typo in the bulleted list remove specific python version
Yep, I forgot the purpose of something I coded myself. subprocess.run() is Python's recommended replacement to popen that doesn't need context management
cbe8b09
to
218a71c
Compare
Note
We should remove the pylint warning suppression on getopt when the next release of pylint comes out due to getopt becoming deprecated for like 3 months
Reduce duplication of sample tests through parameterization, making pytest (and unittest) list the individual now-filterable tests (closes #260)
Update fields of pyproject.toml