by Anonymous » 11 Apr 2025, 21:07
Ich fehlt wahrscheinlich etwas Offensichtliches, aber ich sehe es nicht.
Code: Select all
import pytest
@pytest.fixture
def file_tests():
return "tests.json"
Und dann habe ich meinen Test wie folgt (Datei test1.py ) im selben Ordner wie conftest.py :
Code: Select all
import pytest
from seleniumbase import BaseCase
class MyTestClass(BaseCase):
def test_basics(self, file_tests):
print(file_tests)
< /code>
Aber wenn ich < /p>
ausführepy.test test1.py
< /code>
Ich erhalte einen Fehler < /p>
E TypeError: test_basics() missing 1 required positional argument: 'file_tests'
Was offensichtlich fehlt mir?>
Ich fehlt wahrscheinlich etwas Offensichtliches, aber ich sehe es nicht.[code]import pytest
@pytest.fixture
def file_tests():
return "tests.json"
[/code]
Und dann habe ich meinen Test wie folgt (Datei test1.py ) im selben Ordner wie conftest.py :
[code]import pytest
from seleniumbase import BaseCase
class MyTestClass(BaseCase):
def test_basics(self, file_tests):
print(file_tests)
< /code>
Aber wenn ich < /p>
ausführepy.test test1.py
< /code>
Ich erhalte einen Fehler < /p>
E TypeError: test_basics() missing 1 required positional argument: 'file_tests'
[/code]
Was offensichtlich fehlt mir?>