Repository: sympy/sympy
Pull request: Add test case for bad subset evaluation
<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
Fixes https://github.com/sympy/sympy/issues/9855


#### Brief description of what is fixed or changed
Add test case for issue https://github.com/sympy/sympy/issues/9855


#### Other comments


#### Release Notes

<!-- Write the release notes for this release below between the BEGIN and END
statements. The basic format is a bulleted list with the name of the subpackage
and the release note for this PR. For example:

* solvers
  * Added a new solver for logarithmic equations.

* functions
  * Fixed a bug with log of integers. Formerly, `log(-x)` incorrectly gave `-log(x)`.

* physics.units
  * Corrected a semantical error in the conversion between volt and statvolt which
    reported the volt as being larger than the statvolt.

or if no release note(s) should be included use:

NO ENTRY

See https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more
information on how to write release notes. The bot will check your release
notes automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
NO ENTRY
<!-- END RELEASE NOTES -->


Problem statement:
bad subset evaluation
> > > x, y, z = symbols('x, y, z', real=True)
> > > s1 = Interval(1,x) & Interval(y,2)
> > > s2 = Interval(1,2)
> > > s1.is_subset(s2)
> > > False
> > > simplify(s1.contains(z) >> s2.contains(z))
> > > True

Hints from issue discussion:
Looks like this might be fixed:
```python
>>> s1.is_subset(s2) is None
True
```
The `is_subset` result was changed from False to None in 31c2dfa2ed466bbd644ade6ad14bbfb7ecbb33a0 from #17526.

On the other hand the correct answer is True so None is suboptimal here. I'm not sure if there is a simple way to improve `is_subset` or if there should be some other way of asking more complicated `is_subset` queries like this.
Hello everyone , I wish to fix this issue  could you please assign this  issue to me ?
Issues are not assigned. Feel free to work on this though.

I think that @smichr's intention was that this could be fixed if a test is added for this case somewhere.
Hi, may I be assigned to this issue? I would like to do my best to address it.

Commit message: Add test case for isssue 9855

Patch to review:
diff --git a/sympy/sets/tests/test_sets.py b/sympy/sets/tests/test_sets.py
index 47426479e98f..4bceadbf6f01 100644
--- a/sympy/sets/tests/test_sets.py
+++ b/sympy/sets/tests/test_sets.py
@@ -1744,3 +1744,10 @@ def test_issue_14336():
     x = Symbol("x")
     U -= U.intersect(Ne(x, 1).as_set())
     U -= U.intersect(S.true.as_set())
+
+def test_issue_9855():
+    #https://github.com/sympy/sympy/issues/9855
+    x, y, z = symbols('x, y, z', real=True)
+    s1 = Interval(1,x) & Interval(y,2)
+    s2 = Interval(1,2)
+    assert s1.is_subset(s2) == None


Code review comments:
diff_hunk: @@ -1744,3 +1744,10 @@ def test_issue_14336():
     x = Symbol("x")
     U -= U.intersect(Ne(x, 1).as_set())
     U -= U.intersect(S.true.as_set())
+
+def test_issue_9855():
+    #https://github.com/sympy/sympy/issues/9855
+    x, y, z = symbols('x, y, z', real=True)
+    s1 = Interval(1,x) & Interval(y,2)
+    s2 = Interval(1,2)
path: sympy/sets/tests/test_sets.py
text: @user1:
```suggestion
    s1 = Interval(1, x) & Interval(y, 2)
    s2 = Interval(1, 2)
```

@author:
Sorry I did not see the comment yesterday. Thank you.