Comments (6)
@asvetlov, FYI, as already mentioned in aiohttp#2880.
from pytest-aiohttp.
But loop
fixture recreates an asyncio event loop for every test.
Why do you want to use it in a class
scope.
It is dangerous.
Let's assume your test has a started but not finished yet activities like tasks or loop.call_later
handles.
After the test finishing these activities still are present, they may affect the next test execution.
It breaks the test isolation rule.
from pytest-aiohttp.
Hello @asvetlov,
Why do you want to use it in a class scope.
I don't. I am not sure where you saw that I use the loop in a class fixture but I don't actually do that nor do I want to do that originally. I just upgraded the pytest
dependency and got the above error.
from pytest-aiohttp.
Your output is: ScopeMismatch: You tried to access the 'function' scoped fixture 'loop' with a 'class' scoped request object
I think the line directly points to the problem.
from pytest-aiohttp.
You are correct. Thanks for taking a look at this.
from pytest-aiohttp.
Welcome!
from pytest-aiohttp.
Related Issues (20)
- how to set the port to which web server listen HOT 5
- pytest-aiohttp freezes when using `asyncio.create_subprocess_exec` in a process that reads from stdin HOT 1
- Support for asynchronous `create_app()` function in the fixture HOT 2
- The example uses deprecated `loop` parameter of web.Application HOT 4
- README should talk about avoiding _explicit_ loading pytest module HOT 1
- Compatibility with Python3.8 + Windows HOT 1
- pytest-aiohttp is incompatible with pytest-asyncio v0.14.0 HOT 1
- can't use context vars in shutdown HOT 5
- Setup GitHub test workflow HOT 1
- Improve README
- Tests fail to run with pytest-asyncio==0.18 and asyncio_mode=strict HOT 1
- asyncio_mode deprecation warning is emitted for test suites that don't use aiohttp at all HOT 7
- chardet can't be replaced by cchardet HOT 1
- Follow PEP 561 to support type checking with mypy HOT 4
- Example code does not execute HOT 1
- PytestDeprecationWarning with pytest 7.2.0 HOT 6
- 1.0.4: pytest is failing HOT 1
- every test run twice: pyloop and uvloop HOT 4
- Conflicts with pytest-asyncio (sample with redis) HOT 8
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 pytest-aiohttp.