Aws-sam-cli: Error Running Integration Tests

Created on 2 Dec 2019  路  8Comments  路  Source: aws/aws-sam-cli

Description

I am getting an AttributeError when attempting to run integration tests on this repository after following all instructions from the development guide.

Briefly describe the bug you are facing.

Steps to reproduce

I just forked, cloned, and set up a dev environment for this repository. I followed the instructions in the Development Guide to

  1. install python versions with pyenv
  2. installed Black and pre-commit
  3. created and activated samcli37 virtualenv
  4. run make init
  5. run make pr
  6. run make integ-test

Observed result

____________________________________________________________________ ERROR collecting tests/integration/buildcmd/test_build_cmd.py _____________________________________________________________________ ../../.pyenv/versions/3.7.2/lib/python3.7/unittest/loader.py:235: in getTestCaseNames testFnNames = list(filter(shouldIncludeMethod, dir(testCaseClass))) ../../.pyenv/versions/3.7.2/lib/python3.7/unittest/loader.py:232: in shouldIncludeMethod fullName = '%s.%s' % (testCaseClass.__module__, testFunc.__qualname__) E AttributeError: 'MarkDecorator' object has no attribute '__qualname__'

Expected result

Integration tests to run and pass on fresh environment

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Mac OS 10.15.1
  2. sam --version: latest from repository
typquestion

All 8 comments

@beck3905 Thanks for the issue. My understanding is that this happens when there is an outdated unittest and or pytest on the system. A couple things you can try:

  • Update python3.7 to the latest version (I have 3.7.5 installed personally).
  • Ensure pytest is updated (should be 5.2.1)

Let me know if any of that works. There are some additional details here as well: https://github.com/awslabs/aws-sam-cli/pull/1464#issuecomment-545447568

Closing as this is not a code bug. Feel free to reopen if you need help

@sanathkr I disagree. This may not be a bug with the application code, but I am still unable to successfully run integration tests on a brand new dev environment created from a newly forked version of this repository and following the Development Guide. That suggests that this is a bug in the Development Guide and the repository may not work as described in the Development Guide.

@jfuss I tried with different Python versions including 3.6.8 and 3.7.5 and I get different errors and still fail to run integration tests. One of the errors I saw was an import error for tomlkit despite seeing tomlkit installed in my virtualenv. All of my unit tests are passing and I have been able to successfully run samdev on a template on my local machine in my virtualenv.

@beck3905 Something is not right on your system then. You are probably getting resolved to a different python interpreter than the one you are expecting.

Same problem here. OSX, Installed pyenv and and other instructions in developer guide.
Python 3.7.2
Pytest 5.2.1

I had the same issue. Solved creating a new environment for samcli37 with python 3.7.5.

Thanks @francilioaraujo - I installed python 3.7.5 and setup a new venv and the integration tests now run. (Previous venv was 3.7.2)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joekiller picture joekiller  路  4Comments

goldenbearkin picture goldenbearkin  路  3Comments

asyba picture asyba  路  3Comments

drumadrian picture drumadrian  路  3Comments

debuggins picture debuggins  路  4Comments