python-intermediate-development icon indicating copy to clipboard operation
python-intermediate-development copied to clipboard

Move imports outside of test method code

Open johnnonweiler opened this issue 1 year ago • 2 comments

Closes #266

johnnonweiler avatar Sep 12 '24 12:09 johnnonweiler

On second inspection, there are still some cases in the content where import statements are within code snippets, namely 21-automatically-testing-software.md.

@johnnonweiler if you give me permission to add commits like this then I can add the subsequent changes needed.

Ah, I just realised that I can actually make edits to this PR directly, so no need to do the step in the link I sent.

bielsnohr avatar Sep 25 '24 12:09 bielsnohr

Okay, I think I did a good enough regex search to get all the instances of modules being imported inside of a test function. Because this change expanded beyond what I initially thought it would be, we likely need to verify that all or most of the code snippet changed actually still run properly. I don't have the time for that at the moment, however, we will be running the course again at UKAEA, so we could be the test subjects.

bielsnohr avatar Sep 26 '24 11:09 bielsnohr

Looks good, we'll just need to verify these changes then. After discussion with Aleks, due to time constraints, retiring this PR for now until the material is transitioned to the new Carpentries format, when we'll recreate it and can work on it from there.

steve-crouch avatar Oct 03 '24 11:10 steve-crouch