From 2be25f535823544549cbf3a1a7a0100962c6fece Mon Sep 17 00:00:00 2001 From: Iryna Cherniavska Date: Mon, 26 Oct 2015 15:00:42 -0700 Subject: Setproctitle should be optional in tests. --- tests/test_main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/test_main.py') diff --git a/tests/test_main.py b/tests/test_main.py index 35221fdb..f98aae5e 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -1,6 +1,10 @@ import pytest import platform from pgcli.main import need_completion_refresh, obfuscate_process_password +try: + import setproctitle +except ImportError: + setproctitle = None @pytest.mark.parametrize('sql', [ @@ -12,8 +16,9 @@ def test_need_completion_refresh(sql): @pytest.mark.skipif(platform.system() == 'Windows', reason='Not applicable in windows') +@pytest.mark.skipif(not setproctitle, + reason='setproctitle not available') def test_obfuscate_process_password(): - import setproctitle original_title = setproctitle.getproctitle() setproctitle.setproctitle("pgcli user=root password=secret host=localhost") -- cgit v1.2.3