[ 
https://issues.apache.org/jira/browse/BEAM-8229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16929363#comment-16929363
 ] 

Chad Dombrova commented on BEAM-8229:
-------------------------------------

{quote}
I am not familiar with pytest, but suspected it may have some solutions for 
this problem. I thought that you might know if this is the case.
{quote}

I've used pytest quite a bit and I like it better than nose.  With pytest you 
can create a conftest.py file which can setup exclusions programmatically (e.g. 
based on the current sys.executable), which would help consolidate the 
exclusions by moving them from the nosetests cli args currently in various 
shell scripts and tox.ini, into the test code itself.  It's possible to do this 
with nose as well, but IIRC it takes a bit more boilerplate.



> Python postcommit 2.7 tests are failing since we try to run a test with 
> Python 3.6+ syntax on Python 2.
> -------------------------------------------------------------------------------------------------------
>
>                 Key: BEAM-8229
>                 URL: https://issues.apache.org/jira/browse/BEAM-8229
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: Ahmet Altay
>            Assignee: Udi Meiri
>            Priority: Blocker
>
> Root cause: https://github.com/apache/beam/pull/9098
> 20:12:14 Traceback (most recent call last):
> 20:12:14   File 
> "/home/jenkins/jenkins-slave/workspace/beam_PostCommit_Python2_PR/src/build/gradleenv/-194514014/local/lib/python2.7/site-packages/nose/loader.py",
>  line 418, in loadTestsFromName
> 20:12:14     addr.filename, addr.module)
> 20:12:14   File 
> "/home/jenkins/jenkins-slave/workspace/beam_PostCommit_Python2_PR/src/build/gradleenv/-194514014/local/lib/python2.7/site-packages/nose/importer.py",
>  line 47, in importFromPath
> 20:12:14     return self.importFromDir(dir_path, fqname)
> 20:12:14   File 
> "/home/jenkins/jenkins-slave/workspace/beam_PostCommit_Python2_PR/src/build/gradleenv/-194514014/local/lib/python2.7/site-packages/nose/importer.py",
>  line 94, in importFromDir
> 20:12:14     mod = load_module(part_fqname, fh, filename, desc)
> 20:12:14 SyntaxError: invalid syntax (external_test_py37.py, line 46)



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to