diff --git a/lifelines/tests/__main__.py b/lifelines/tests/__main__.py index 151ef3e40..7a9ed25fe 100644 --- a/lifelines/tests/__main__.py +++ b/lifelines/tests/__main__.py @@ -4,4 +4,4 @@ if __name__ == '__main__': # Exit with correct code - sys.exit(pytest.main("--pyargs lifelines.tests")) + sys.exit(pytest.main(["--pyargs", "lifelines.tests"] + sys.argv[1:])) diff --git a/lifelines/tests/test_estimation.py b/lifelines/tests/test_estimation.py index 8f20b4da5..5f912e242 100644 --- a/lifelines/tests/test_estimation.py +++ b/lifelines/tests/test_estimation.py @@ -192,6 +192,7 @@ def test_kmf_left_censorship_stats(self): assert kmf.cumulative_density_[kmf._label].ix[0] == 0.0 assert kmf.cumulative_density_[kmf._label].ix[12] == 1.0 + @pytest.mark.plottest @pytest.mark.skipif("DISPLAY" not in os.environ, reason="requires display") def test_kmf_left_censorship_plots(self): kmf = KaplanMeierFitter() @@ -662,6 +663,7 @@ def test_large_dimensions_for_recursion_error(self): aaf = AalenAdditiveFitter() aaf.fit(X) + @pytest.mark.plottest @pytest.mark.skipif("DISPLAY" not in os.environ, reason="requires display") def test_aaf_panel_dataset(self): panel_dataset = load_panel_test() @@ -688,6 +690,7 @@ def test_aalen_additive_median_predictions_split_data(self): T_pred = aaf.predict_median(X[list(range(6))]) assert abs((T_pred.values > T).mean() - 0.5) < 0.05 + @pytest.mark.plottest @pytest.mark.skipif("DISPLAY" not in os.environ, reason="requires display") def test_aalen_additive_fit_no_censor(self): # this is a visual test of the fitting the cumulative @@ -713,6 +716,7 @@ def test_aalen_additive_fit_no_censor(self): plt.show() return + @pytest.mark.plottest @pytest.mark.skipif("DISPLAY" not in os.environ, reason="requires display") def test_aalen_additive_fit_with_censor(self): # this is a visual test of the fitting the cumulative diff --git a/lifelines/tests/test_plotting.py b/lifelines/tests/test_plotting.py index 20690128e..464a36139 100644 --- a/lifelines/tests/test_plotting.py +++ b/lifelines/tests/test_plotting.py @@ -9,6 +9,7 @@ from ..plotting import plot_lifetimes +@pytest.mark.plottest @pytest.mark.skipif("DISPLAY" not in os.environ, reason="requires display") class TestPlotting():