changeset 90af2796cdd5 in modules/account_payment_stripe:4.6
details: 
https://hg.tryton.org/modules/account_payment_stripe?cmd=changeset;node=90af2796cdd5
description:
        Skip scenario that requires environment that is not set
        (grafted from 0a69068bf926e41e0db70238ddf38d8bd33b784d)
diffstat:

 tests/test_account_payment_stripe.py |  17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diffs (33 lines):

diff -r 6c0f588304ab -r 90af2796cdd5 tests/test_account_payment_stripe.py
--- a/tests/test_account_payment_stripe.py      Fri Mar 15 19:31:54 2019 +0100
+++ b/tests/test_account_payment_stripe.py      Fri Nov 02 20:07:30 2018 +0100
@@ -1,10 +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 doctest
+import os
 import unittest
 
-import doctest
-
 from trytond.tests.test_tryton import ModuleTestCase
 from trytond.tests.test_tryton import suite as test_suite
 from trytond.tests.test_tryton import doctest_teardown
@@ -20,9 +19,11 @@
     suite = test_suite()
     suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
             AccountPaymentStripeTestCase))
-    suite.addTests(doctest.DocFileSuite(
-            'scenario_account_payment_stripe.rst',
-            tearDown=doctest_teardown, encoding='utf-8',
-            checker=doctest_checker,
-            optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
+    if (os.getenv('STRIPE_SECRET_KEY')
+            and os.getenv('STRIPE_PUBLISHABLE_KEY')):
+        suite.addTests(doctest.DocFileSuite(
+                'scenario_account_payment_stripe.rst',
+                tearDown=doctest_teardown, encoding='utf-8',
+                checker=doctest_checker,
+                optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
     return suite

Reply via email to