Skip to content

Commit

Permalink
fix: make python tests dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
agdimech committed May 13, 2022
1 parent e143001 commit 3cb2261
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import * as fs from "fs";
import * as path from "path";
import { SampleDir } from "projen";
import { AwsCdkPythonApp, AwsCdkPythonAppOptions } from "projen/lib/awscdk";
Expand Down Expand Up @@ -46,15 +47,24 @@ export class PDKPipelinePyProject extends AwsCdkPythonApp {
this.pytest = new Pytest(this, options.pytestOptions);

new SampleDir(this, this.testdir, {
sourceDir: path.join(
__dirname,
"..",
"..",
"..",
"samples",
"sample-pdk-pipeline-py",
"tests"
),
files: {
"__init__.py": "",
"test_pipeline.py": fs
.readFileSync(
path.join(
__dirname,
"..",
"..",
"..",
"samples",
"sample-pdk-pipeline-py",
"tests",
"test_pipeline.py"
)
)
.toString()
.replace("infra.", `${this.moduleName}.`),
},
});
}
}
15 changes: 0 additions & 15 deletions samples/sample-pdk-pipeline-py/tests/test_example.py

This file was deleted.

0 comments on commit 3cb2261

Please sign in to comment.