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

Redux: Abort collection and exit when an autoused fixture encounters a syntax error #9139

Open
ChanceNCounter opened this issue Sep 30, 2021 · 1 comment
Labels
type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature

Comments

@ChanceNCounter
Copy link

If you write a fixture which imports code, and that code contains a syntax error, pytest will continue collecting tests, and then it will print a failure for each collected test.

This is time-consuming and annoying.


I was rudely dismissed when I first reported this, and then got flak for getting frustrated. This is consistent with my overall experience with pytest, on GitHub and out in the community.

This was how the last thread ended:

Hi @ChanceNCounter,

I do not, however, appreciate the attitude.
No kidding.
Does this project set out to upset users?
on't worry about why, because I am SO FAR BEYOND not in the mood to argue with you.

This interaction does not conform to our contributing guidelines, so I'm locking this conversation.

Feel free to open another issue using the appropriate tone of someone using a free tool maintained by volunteers, which we do our best to do.

If you are not "in the mood" to change your tone, please don't bother, but otherwise we will be happy to continue the discussion.

Pytest is an industry-standard tool to which, as I mentioned in that issue, untold thousands of programmers are professionally handcuffed.

This was only the most recent occasion on which Pytest cost me hours upon hours, and I had to refactor all my tests to get around a simple problem: I need to mock several environment variables over and over.

Last time around, one full workday to discover that the only reliable way to run tests in a prescribed order is to use a plugin. An understandable performance tradeoff, poorly documented. I should not have to rely on StackOverflow for things like that.

I have literally spent hundreds of hours fighting with Pytest, in various circumstances, and its "community" is consistently rude and dismissive. Problems aren't problems, you're just doing it wrong! (The documentation reads like a very thorough refresher for people who already know Pytest intimately.

Perhaps this is the first time anyone's put it in terms: I also maintain free software, and, like most Python devs, I rely on Pytest to keep my teams' projects working. I am the only one on any of my teams willing to try anything fancy with Pytest. Everybody else, anytime the solution requires unfamiliar imports, just says, "Screw it," and writes integration tests where there should be unit tests. Why?

Because the documentation is obtuse and you guys treat everybody else this way, always

@nicoddemus
Copy link
Member

nicoddemus commented Oct 1, 2021

Hi @ChanceNCounter,

Thanks for writing a new issue.

If you write a fixture which imports code, and that code contains a syntax error, pytest will continue collecting tests, and then it will print a failure for each collected test.

This is time-consuming and annoying.

I agree with you, I think we could skip collection entirely if we encounter a SyntaxError anywhere. I fail to imagine a case where continuing the collection would be useful.


As for the off-topic comments:

I have literally spent hundreds of hours fighting with Pytest, in various circumstances

That's unfortunate, I'm sorry that's been your experience.

and its "community" is consistently rude and dismissive.

Sorry, I can say for myself that I always try to be understandable and not dismiss anything without a solution/workaround, however I must say that I have often heard the contrary, that the pytest community is very helpful overall (of course I might be biased).

Because the documentation is obtuse

I definitely agree our documentation could be greatly improved. However I don't think any of the current maintainers (myself included, even though I have spent many hours working on documentation) really likes to work on documentation, at the same time I believe nobody disagrees that it is a very important aspect of the project (any project in fact).

and you guys treat everybody else this way, always

Sorry you feel this way, I agree responses might be short and seem dismissive. We should try to do better.

Now about:

I was rudely dismissed when I first reported this, and then got flak for getting frustrated.

IMO you getting frustrated doesn't really justify you lashing out at others. Everybody involved gets more out of the discussion (specially in a forum like on GitHub) if everybody is civil.

Also I don't think you were "dismissed", but I agree that the response you got was terse, and understand you getting frustrated.

@nicoddemus nicoddemus added the type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature label Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature
Projects
None yet
Development

No branches or pull requests

2 participants