Opened 3 years ago

Last modified 9 months ago

#822 assigned enhancement

Create proper Unit Testing directory structure for SasModels

Reported by: piotr Owned by: richardh
Priority: major Milestone: SasView 4.3.0
Component: sasmodels Keywords:
Cc: Work Package: SasView Framework Enhancements

Description


Change History (6)

comment:1 Changed 2 years ago by butler

  • Milestone changed from SasView 4.2.0 to SasView 4.3.0
  • Work Package changed from SasView Bug Fixing to SasView Framework Enhancements

comment:2 Changed 14 months ago by pkienzle

Could extend the test environment within each model file to allow structure factor tests. That way user models can include structure factor evaluations.

something like:

tests = [
    [{}, 0.0005, 859.916526646],
    [{}, 0.100600200401, 1.77063682331],
    [{}, 0.5, 0.00355351388906],
    [{'@S': 'hardsphere',          # hard sphere structure factor
      'structure_factor_type': 1,  # decoupling approximation
      'effective_radius_type': 1,  # equivalent sphere
     }, 0.5, ????],
]

Need some rejiggering of model_test.py, but easy enough.

Last edited 14 months ago by pkienzle (previous) (diff)

comment:3 Changed 14 months ago by Paul Kienzle <pkienzle@…>

In 81751c29b389be731a04ab84a1a93dedf718e16a/sasmodels:

allow structure factor tests in model file. Refs #822.

comment:4 Changed 9 months ago by GitHub <noreply@…>

  • Owner set to GitHub <noreply@…>
  • Resolution set to fixed
  • Status changed from new to closed

In 29c455af8add2421edd313d03218d6a1ba3b7873/sasmodels:

Merge pull request #90 from SasView?/beta_approx

Beta approx

closes #1201
closes #1202
closes #822
closes #1076

comment:5 Changed 9 months ago by pkienzle

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening.

The original request wasn't satisfied, which was to restructure sasmodels tests to use proper Unit Testing directory structure.

Python has a variety of "proper" test structures such as:

  • embedded: put tests in package/code.py
  • sub-package: put tests package/test/code_test.py
  • separate: put tests in test/package/code_test.py

and test styles:

  • py.test
  • nose
  • nose2
  • unittest

Currently using embedded nose tests which py.test can identify.

Discuss whether this should be changed before closing this ticket.

comment:6 Changed 9 months ago by richardh

  • Component changed from SasView to sasmodels
  • Owner changed from GitHub <noreply@…> to richardh
  • Status changed from reopened to assigned

Created new branch in sasmodels ticket_822_v5_unit_tests, to start adding unit tests for @S(Q) and beta(Q) approx in sasview 5 as per http://trac.sasview.org/ticket/822#comment:2 above, using this ticket number as a reference.

Will assign this ticket to myself for now.

Note: See TracTickets for help on using tickets.