src/eric7/Testing/Interfaces/PytestRunner.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9549
67295777d9fe
child 9653
e67609152c5e
equal deleted inserted replaced
9481:0b936ff1bbb9 9482:a2bc06a54d9d
11 import json 11 import json
12 import os 12 import os
13 import sys 13 import sys
14 import time 14 import time
15 15
16 sys.path.insert(2, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))) 16 sys.path.insert(
17 2,
18 os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")),
19 )
20 # three times up is our installation directory
17 21
18 with contextlib.suppress(ImportError): 22 with contextlib.suppress(ImportError):
19 import pytest 23 import pytest
20 24
21 25
299 """ 303 """
300 Function to determine the framework version and versions of all available 304 Function to determine the framework version and versions of all available
301 plugins. 305 plugins.
302 """ 306 """
303 try: 307 try:
304 import pytest 308 import pytest # __IGNORE_WARNING_I10__
305 309
306 versions = { 310 versions = {
307 "name": "pytest", 311 "name": "pytest",
308 "version": pytest.__version__, 312 "version": pytest.__version__,
309 "plugins": [], 313 "plugins": [],
324 def getMarkers(): 328 def getMarkers():
325 """ 329 """
326 Function to determine the defined markers and their descriptions. 330 Function to determine the defined markers and their descriptions.
327 """ 331 """
328 try: 332 try:
329 import pytest 333 import pytest # __IGNORE_WARNING_I10__
330 334
331 # --capture=sys needed on Windows to avoid 335 # --capture=sys needed on Windows to avoid
332 # ValueError: saved filedescriptor not valid anymore 336 # ValueError: saved filedescriptor not valid anymore
333 plugin = GetMarkersPlugin() 337 plugin = GetMarkersPlugin()
334 pytest.main(["--markers", "--capture=sys"], plugins=[plugin]) 338 pytest.main(["--markers", "--capture=sys"], plugins=[plugin])

eric ide

mercurial