Skip to content

Commit feba0f4

Browse files
authored
remove xdist support (#11)
1 parent 31d78aa commit feba0f4

File tree

3 files changed

+4
-21
lines changed

3 files changed

+4
-21
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "pytest-httpdbg"
77
authors = [
88
{name = "cle-b", email = "[email protected]"},
99
]
10-
description="A pytest plugin to record HTTP(S) requests with stack trace"
10+
description="A pytest plugin to record HTTP(S) requests with stack trace."
1111
readme="README.md"
1212
requires-python = ">=3.9.0"
1313
license = {text = "Apache-2.0"}
@@ -24,7 +24,7 @@ classifiers = [
2424
]
2525
dynamic = ["version"]
2626
dependencies = [
27-
"httpdbg>=0.29.0",
27+
"httpdbg>=0.32.0",
2828
"pytest>=7.0.0"
2929
]
3030

pytest_httpdbg/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# -*- coding: utf-8 -*-
22
from pytest_httpdbg.plugin import httpdbg_record_filename # noqa F401
33

4-
__version__ = "0.6.1"
4+
__version__ = "0.7.0"

pytest_httpdbg/plugin.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# -*- coding: utf-8 -*-
22
import glob
33
import os
4-
import pickle
54
import time
65
from typing import Optional
7-
import uuid
86

97
import pytest
108

@@ -100,10 +98,7 @@ def pytest_configure(config):
10098

10199
@pytest.hookimpl(hookwrapper=True)
102100
def pytest_runtest_protocol(item: pytest.Item, nextitem: Optional[pytest.Item]):
103-
if item.config.option.httpdbg or (
104-
("HTTPDBG_SUBPROCESS_DIR" in os.environ)
105-
and ("PYTEST_XDIST_WORKER" in os.environ)
106-
):
101+
if item.config.option.httpdbg:
107102
with httprecord(initiators=item.config.option.httpdbg_initiator) as records:
108103
# the record of the http requests has been enable using a pytest command line argument
109104
# -> first, we stash the path to the log file
@@ -118,18 +113,6 @@ def pytest_runtest_protocol(item: pytest.Item, nextitem: Optional[pytest.Item]):
118113

119114
yield
120115

121-
# pytest is executed using pyhttpdbg
122-
# -> we serialize the HTTPRecords object to share it with the main pyhttpdbg process
123-
if "HTTPDBG_SUBPROCESS_DIR" in os.environ:
124-
if "PYTEST_XDIST_WORKER" in os.environ:
125-
if len(records.requests) > 0:
126-
fname = f"{os.environ['HTTPDBG_SUBPROCESS_DIR']}/{uuid.uuid1()}"
127-
with open(f"{fname}.httpdbgrecords.tmp", "wb") as f:
128-
pickle.dump(records, f)
129-
os.rename(
130-
f"{fname}.httpdbgrecords.tmp", f"{fname}.httpdbgrecords"
131-
)
132-
133116
# the record of the http requests has been enable using a pytest command line argument
134117
# -> we create a human readable file that contains all the HTTP requests recorded
135118
if httpdbg_record_filename in item.stash:

0 commit comments

Comments
 (0)