Comments (6)
- When you have duplicate test names
from flake8-pytest-style.
Hi @sobolevn,
I'm not sure I agree that this rule should be enforced. Per the pytest docs, layout without __init__.py
files is only one of supported layouts, and an alternative layout with multiple packages and __init__.py
files is also supported. I've seen both in my experience, both have pros and cons, and I don't really feel that either of them should be enforced for all projects.
from flake8-pytest-style.
That's why I have added a note about a configuration:
It is probably a good idea to make this configurable:
tests path
style: with __init__.py or without
from flake8-pytest-style.
My bad, must've missed it :(
I'll keep this in mind, thanks
from flake8-pytest-style.
Having this configurable is a good idea. While pytest emulates the presence of __init__.py
, there are cases when this may break (especially when you also have to support Python 2).
I personally like not having __init__.py
, but FTR here's some corner cases that I met:
- various tooling does not support/understand implicit namespaces or such support is implemented poorly
- when the custom import machinery is implemented, it may conflict with what pytest does and it has to be disabled (this is the case I saw in Ansible, in particular)
It's probably worth mentioning the presence of the exceptional cases in the doc for the rule, once implemented.
from flake8-pytest-style.
unless importlib mode is used, its wrong to drop them
from flake8-pytest-style.
Related Issues (20)
- I want a rule that will find tests without assert statements HOT 1
- False positive PT019 with monkey patching and _ in test signature HOT 2
- False positive PT009 for unittest.TestCase.assertRaises HOT 5
- Feature request: automatic fixing per certain rules HOT 5
- Review assertion method names for PT009/PT027
- Research PT009 for Django assertions HOT 1
- When I have pytest.fail() in a test, it is incorrectly detected as a unittest-style assertion HOT 1
- I want a rule that will check use of `argnames` and `argvalues` in `@pytest.mark.parametrize` HOT 1
- I want a rule that will flag Exception in raises() contexts. HOT 2
- I want a rule that will disallow patching `os.environ` with `mock.patch.dict`
- I want a rule that will check pytest.approx parameters
- PT017 violated in non-test code HOT 2
- I want a rule that will check that aren't parenthesis opening characters in tests ids
- I want a rule that will catch `@pytest.mark.django_db()()`
- I want a rule that will detect unused fixture as argument and instruct to use pytest.mark.usefixtures instead
- Rule that suggests explicit `strict=` in `@pytest.mark.xfail` HOT 2
- reverse pytest-mark-no-parenthese and pytest-fixture-no-parentheses HOT 6
- Only enable flake-pytest-style when pytest is in use HOT 1
- [false-positive][PT019] When I have a test with an underscored parameter name, it incorrectly suggests switching to `usefixtures` HOT 3
- When I pass `reason` instead of `msg` to `pytest.fail()` PT016 is flagged
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flake8-pytest-style.