Skip to content

Commit 2324754

Browse files
authored
Fix flask app variable in debug configuration and flask unit tests (microsoft#1641)
* Fix flask app variable and tests
1 parent 128d231 commit 2324754

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

news/2 Fixes/1634.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Modify the `FLASK_APP` environment variable in the flask debug configuration to include just the name of the application file.

news/3 Code Health/1640.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix unit tests used to test flask template debugging on AppVeyor for the experimental debugger.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@
392392
"module": "flask",
393393
"cwd": "^\"\\${workspaceFolder}\"",
394394
"env": {
395-
"FLASK_APP": "^\"\\${workspaceFolder}/app.py\""
395+
"FLASK_APP": "app.py"
396396
},
397397
"args": [
398398
"run",
@@ -685,7 +685,7 @@
685685
"request": "launch",
686686
"module": "flask",
687687
"env": {
688-
"FLASK_APP": "${workspaceFolder}/app.py"
688+
"FLASK_APP": "app.py"
689689
},
690690
"args": [
691691
"run",
@@ -808,7 +808,7 @@
808808
"request": "launch",
809809
"module": "flask",
810810
"env": {
811-
"FLASK_APP": "^\"\\${workspaceFolder}/app.py\""
811+
"FLASK_APP": "app.py"
812812
},
813813
"args": [
814814
"run",
@@ -1107,7 +1107,7 @@
11071107
"request": "launch",
11081108
"module": "flask",
11091109
"env": {
1110-
"FLASK_APP": "${workspaceFolder}/app.py"
1110+
"FLASK_APP": "app.py"
11111111
},
11121112
"args": [
11131113
"run",

src/test/debugger/web.framework.test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { EXTENSION_ROOT_DIR } from '../../client/common/constants';
1313
import { noop } from '../../client/common/core.utils';
1414
import { DebugOptions, LaunchRequestArguments } from '../../client/debugger/Common/Contracts';
1515
import { PYTHON_PATH, sleep } from '../common';
16-
import { IS_APPVEYOR, IS_MULTI_ROOT_TEST, TEST_DEBUGGER } from '../initialize';
16+
import { IS_MULTI_ROOT_TEST, TEST_DEBUGGER } from '../initialize';
1717
import { DEBUGGER_TIMEOUT } from './common/constants';
1818
import { continueDebugging, createDebugAdapter, ExpectedVariable, hitHttpBreakpoint, makeHttpRequest, validateVariablesInFrame } from './utils';
1919

@@ -62,7 +62,7 @@ suite(`Django and Flask Debugging: ${debuggerType}`, () => {
6262
const port = await getFreePort({ host: 'localhost' });
6363
const options = buildLaunchArgs(workspaceDirectory);
6464

65-
options.env!['FLASK_APP'] = path.join(workspaceDirectory, 'run.py');
65+
options.env!['FLASK_APP'] = 'run.py';
6666
options.module = 'flask';
6767
options.debugOptions = [DebugOptions.RedirectOutput, DebugOptions.Jinja];
6868
options.args = [
@@ -129,10 +129,7 @@ suite(`Django and Flask Debugging: ${debuggerType}`, () => {
129129
expect(htmlResult).to.contain('Hello this_is_another_value_from_server');
130130
}
131131

132-
test('Test Flask Route and Template debugging', async function () {
133-
if (IS_APPVEYOR) {
134-
return this.skip();
135-
}
132+
test('Test Flask Route and Template debugging', async () => {
136133
const workspaceDirectory = path.join(EXTENSION_ROOT_DIR, 'src', 'testMultiRootWkspc', 'workspace5', 'flaskApp');
137134
const { options, port } = await buildFlaskLaunchArgs(workspaceDirectory);
138135

0 commit comments

Comments
 (0)