diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..7109742ade7a970d85553f120757a46653e3d353 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,6 @@ +def pytest_addoption(parser): + parser.addoption( + "--run-integration-tests", + action="store_true", + help="Run integration tests as well as unit tests" + ) diff --git a/tests/test_websockets.py b/tests/test_websockets.py index afe15b85b9087e31fe8a8b808fe825299517e483..63f888cbe1d8108d4433dd1099f844868bde6ede 100644 --- a/tests/test_websockets.py +++ b/tests/test_websockets.py @@ -11,6 +11,14 @@ from paho.mqtt.client import WebsocketConnectionError from testsupport.broker import fake_websocket_broker +pytestmark = [ + pytest.mark.skipif( + not pytest.config.getoption("--run-integration-tests"), + reason="Specify --run-integration-tests to run these tests", + ), +] + + @pytest.fixture def init_response_headers(): # "Normal" websocket response from server @@ -239,4 +247,3 @@ class TestValidHeaders(object): mqttc.connect("localhost", 1888, keepalive=10) mqttc.disconnect() -