Skip to content

Commit

Permalink
fix(cli): Python init template does not work in directory with '-' (a…
Browse files Browse the repository at this point in the history
…ws#15939)

fixes aws#15938

Pytest error after init sample-app on directory "aws-data-pipeline"

```
E     File "C:\Users\<...>\aws-data-pipeline\tests\unit\test_aws_data_pipe
E       from aws-data-pipeline.aws_data_pipeline_stack import AwsDataPipelineStack
E               ^
E   SyntaxError: invalid syntax
```

See aws#15938 for detials

I was having trouble getting the aws-cdk build and tests running in my dev env.  I think its some issues trying to build the code on windows.  Do you have any recommendations on how to best add a test for this change?

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
Pearcekieser authored and smguggen committed Aug 24, 2021
1 parent 626b646 commit 457908a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest

from aws_cdk import core
from %name%.%name.PythonModule%_stack import %name.PascalCased%Stack
from %name.PythonModule%.%name.PythonModule%_stack import %name.PascalCased%Stack


def get_template():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest

import aws_cdk_lib as core
from %name%.%name.PythonModule%_stack import %name.PascalCased%Stack
from %name.PythonModule%.%name.PythonModule%_stack import %name.PascalCased%Stack


def get_template():
Expand Down
1 change: 1 addition & 0 deletions packages/aws-cdk/test/integ/init/test-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ for template in $templates; do
pip install -r requirements.txt

cdk synth
pytest
done

0 comments on commit 457908a

Please sign in to comment.