Skip to content

Fix flask app variable in debug configuration and flask unit tests #1641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/2 Fixes/1634.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Modify the `FLASK_APP` environment variable in the flask debug configuration to include just the name of the application file.
1 change: 1 addition & 0 deletions news/3 Code Health/1640.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix unit tests used to test flask template debugging on AppVeyor for the experimental debugger.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@
"module": "flask",
"cwd": "^\"\\${workspaceFolder}\"",
"env": {
"FLASK_APP": "^\"\\${workspaceFolder}/app.py\""
"FLASK_APP": "app.py"
},
"args": [
"run",
Expand Down Expand Up @@ -685,7 +685,7 @@
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "${workspaceFolder}/app.py"
"FLASK_APP": "app.py"
},
"args": [
"run",
Expand Down Expand Up @@ -808,7 +808,7 @@
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "^\"\\${workspaceFolder}/app.py\""
"FLASK_APP": "app.py"
},
"args": [
"run",
Expand Down Expand Up @@ -1107,7 +1107,7 @@
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "${workspaceFolder}/app.py"
"FLASK_APP": "app.py"
},
"args": [
"run",
Expand Down
9 changes: 3 additions & 6 deletions src/test/debugger/web.framework.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { EXTENSION_ROOT_DIR } from '../../client/common/constants';
import { noop } from '../../client/common/core.utils';
import { DebugOptions, LaunchRequestArguments } from '../../client/debugger/Common/Contracts';
import { PYTHON_PATH, sleep } from '../common';
import { IS_APPVEYOR, IS_MULTI_ROOT_TEST, TEST_DEBUGGER } from '../initialize';
import { IS_MULTI_ROOT_TEST, TEST_DEBUGGER } from '../initialize';
import { DEBUGGER_TIMEOUT } from './common/constants';
import { continueDebugging, createDebugAdapter, ExpectedVariable, hitHttpBreakpoint, makeHttpRequest, validateVariablesInFrame } from './utils';

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

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

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

Expand Down