Skip to content

Commit

Permalink
Work around weird behaviour of exec in py3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
gmatteo committed Mar 24, 2017
1 parent 4906108 commit f4afa7b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion abipy/electrons/tests/test_psps.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from abipy.core.testing import *
from abipy.electrons.psps import PspsFile

from abipy.core.testing import has_matplotlib


Expand Down
11 changes: 11 additions & 0 deletions abipy/examples/tests/test_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
from __future__ import print_function, division, unicode_literals, absolute_import

import sys
import os
import unittest

Expand All @@ -16,6 +17,16 @@ def test_plots(self):
if not self.has_matplotlib():
raise unittest.SkipTest("sympy is not installed")

#0 file /home/travis/build/abinit/abipy/abipy/examples/tests/../plot/plot_qpconverge.py
# Traceback (most recent call last):
# File "/home/travis/build/abinit/abipy/abipy/examples/tests/test_plots.py", line 29, in test_plots
# exec(fh.read())
# File "<string>", line 16, in <module>
# File "<string>", line 16, in <listcomp>
#NameError: name 'abidata' is not defined
if sys.version[0:3] >= '3.4':
raise unittest.SkipTest("Weird behaviour of exec when Python version >= 3.4")

import matplotlib.pyplot as plt

plot_dir = os.path.join(root, "..", "plot")
Expand Down

0 comments on commit f4afa7b

Please sign in to comment.