diff --git a/tests/test_shipping_ups.py b/tests/test_shipping_ups.py index b3ab4badc8..71da8a73d3 100644 --- a/tests/test_shipping_ups.py +++ b/tests/test_shipping_ups.py @@ -1,8 +1,9 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -import unittest import doctest +import os +import unittest from trytond.tests.test_tryton import ModuleTestCase from trytond.tests.test_tryton import suite as test_suite @@ -18,8 +19,12 @@ def suite(): suite = test_suite() suite.addTests(unittest.TestLoader().loadTestsFromTestCase( ShippingUpsTestCase)) - suite.addTests(doctest.DocFileSuite('scenario_shipping_ups.rst', - tearDown=doctest_teardown, encoding='utf-8', - optionflags=doctest.REPORT_ONLY_FIRST_FAILURE, - checker=doctest_checker)) + if (os.getenv('UPS_USER_ID') + and os.getenv('UPS_PASSWORD') + and os.getenv('UPS_LICENSE') + and os.getenv('UPS_ACCOUNT_NUMBER')): + suite.addTests(doctest.DocFileSuite('scenario_shipping_ups.rst', + tearDown=doctest_teardown, encoding='utf-8', + optionflags=doctest.REPORT_ONLY_FIRST_FAILURE, + checker=doctest_checker)) return suite