Skip to content

Commit

Permalink
Fix flask app variable in debug configuration and flask unit tests (#…
Browse files Browse the repository at this point in the history
…1641)

* Fix flask app variable and tests
  • Loading branch information
DonJayamanne authored May 8, 2018
1 parent 128d231 commit 2324754
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
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

0 comments on commit 2324754

Please sign in to comment.