Giter VIP home page Giter VIP logo

Comments (6)

sobolevn avatar sobolevn commented on August 22, 2024 1
  1. When you have duplicate test names

from flake8-pytest-style.

m-burst avatar m-burst commented on August 22, 2024

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.

sobolevn avatar sobolevn commented on August 22, 2024

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.

m-burst avatar m-burst commented on August 22, 2024

My bad, must've missed it :(
I'll keep this in mind, thanks

from flake8-pytest-style.

webknjaz avatar webknjaz commented on August 22, 2024

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:

  1. various tooling does not support/understand implicit namespaces or such support is implemented poorly
  2. 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.

RonnyPfannschmidt avatar RonnyPfannschmidt commented on August 22, 2024

unless importlib mode is used, its wrong to drop them

from flake8-pytest-style.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.