Skip to content

Commit

Permalink
qase-python: fixed an issue with xdist
Browse files Browse the repository at this point in the history
Fixed the issue where the test run would not complete if the xDist package was disabled or not installed.
  • Loading branch information
gibiw committed Apr 29, 2024
1 parent 0183fdb commit 2374f10
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion qase-pytest/src/qase/pytest/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ def pytest_sessionstart(self, session):

def pytest_sessionfinish(self, session, exitstatus):
if is_xdist_controller(session):
self.reporter.complete_run(exitstatus)
QasePytestPlugin.drop_run_id()
else:
self.reporter.complete_worker()

self.reporter.complete_run(exitstatus)

@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_protocol(self, item):
self.ignore = True if item.get_closest_marker("qase_ignore") else False
Expand Down
2 changes: 1 addition & 1 deletion qase-python-commons/src/qase/commons/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get(self, key, default=None, value_type=None):
# Use _get_config method to get the value. If None, return default.
value = self._get_config(key)
if value_type and value_type == bool:
return self.parseBool(value or default)
return self.parseBool(value)
return value or default

def validate_config(self):
Expand Down
2 changes: 1 addition & 1 deletion qase-python-commons/src/qase/commons/reporters/testops.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self, config: ConfigManager, logger: Logger) -> None:
self.project_code = self.config.get('testops.project')
self.run_id = int(run_id) if run_id else run_id
self.plan_id = int(plan_id) if plan_id else plan_id
self.defect = self.config.get('testops_defect', False, bool)
self.defect = self.config.get('testops.defect', False, bool)
self.complete_after_run = self.config.get('testops.run.complete', True, bool)
self.environment = None

Expand Down

0 comments on commit 2374f10

Please sign in to comment.