Skip scenario that requires environment that is not set

This commit is contained in:
Cédric Krier committed 2018-11-02 20:07:30 +01:00
1 parent 8632716255
commit 27e866ebf3
1 file changed
+10 -5
+10 -5
View File
@@ -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