mirror of
				https://github.com/Textualize/textual.git
				synced 2025-10-17 02:38:12 +03:00 
			
		
		
		
	After upgrading `pytest-asyncio` to the latest version, lots of tests started failing in CI only on Python 3.9: `RuntimeError: There is no current event loop in thread 'MainThread'` Apparently these tests may have only been passing previously due to issues in earlier versions of `pytest-asyncio`. Changing these tests to async seems to fix the failures on Python 3.9. Related issue: https://github.com/pytest-dev/pytest-asyncio/issues/1039
		
			
				
	
	
		
			30 lines
		
	
	
		
			796 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			796 B
		
	
	
	
		
			Python
		
	
	
	
	
	
from __future__ import annotations
 | 
						|
 | 
						|
from textual.app import App
 | 
						|
 | 
						|
 | 
						|
async def test_textual_env_var(monkeypatch):
 | 
						|
    monkeypatch.setenv("TEXTUAL", "")
 | 
						|
    app = App()
 | 
						|
    assert app.features == set()
 | 
						|
    assert app.devtools is None
 | 
						|
    assert app.debug is False
 | 
						|
 | 
						|
    monkeypatch.setenv("TEXTUAL", "devtools")
 | 
						|
    app = App()
 | 
						|
    assert app.features == {"devtools"}
 | 
						|
    assert app.devtools is not None
 | 
						|
    assert app.debug is False
 | 
						|
 | 
						|
    monkeypatch.setenv("TEXTUAL", "devtools,debug")
 | 
						|
    app = App()
 | 
						|
    assert app.features == {"devtools", "debug"}
 | 
						|
    assert app.devtools is not None
 | 
						|
    assert app.debug is True
 | 
						|
 | 
						|
    monkeypatch.setenv("TEXTUAL", "devtools, debug")
 | 
						|
    app = App()
 | 
						|
    assert app.features == {"devtools", "debug"}
 | 
						|
    assert app.devtools is not None
 | 
						|
    assert app.debug is True
 |